namespace WebsiteClient.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Registration : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.Registrations", "Event_EventId", "dbo.Events");
            DropIndex("dbo.Registrations", new[] { "Event_EventId" });
            DropColumn("dbo.Registrations", "Event_Id");
            RenameColumn(table: "dbo.Registrations", name: "Event_EventId", newName: "Event_Id");
            AlterColumn("dbo.Registrations", "Event_Id", c => c.Int(nullable: false));
            CreateIndex("dbo.Registrations", "Event_Id");
            AddForeignKey("dbo.Registrations", "Event_Id", "dbo.Events", "EventId", cascadeDelete: true);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Registrations", "Event_Id", "dbo.Events");
            DropIndex("dbo.Registrations", new[] { "Event_Id" });
            AlterColumn("dbo.Registrations", "Event_Id", c => c.Int());
            RenameColumn(table: "dbo.Registrations", name: "Event_Id", newName: "Event_EventId");
            AddColumn("dbo.Registrations", "Event_Id", c => c.Int(nullable: false));
            CreateIndex("dbo.Registrations", "Event_EventId");
            AddForeignKey("dbo.Registrations", "Event_EventId", "dbo.Events", "EventId");
        }
    }
}
